package com.tencent.mm.opensdk.modelmsg;

import android.os.Bundle;
import android.util.Log;

import com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject;

public class WXMusicObject implements IMediaObject {
    private static final int LENGTH_LIMIT = 10240;
    private static final String TAG = "MicroMsg.SDK.WXMusicObject";
    public String musicDataUrl;
    public String musicLowBandDataUrl;
    public String musicLowBandUrl;
    public String musicUrl;

    public WXMusicObject() {

    }

    public boolean checkArgs() {
        int v2 = 10240;
        boolean v0 = false;
        if(this.musicUrl == null || this.musicUrl.length() == 0) {
            if(this.musicLowBandUrl != null && this.musicLowBandUrl.length() != 0) {
            }else {
                Log.e("MicroMsg.SDK.WXMusicObject", "both arguments are null");
                return false;
            }
        }
        if(this.musicUrl != null && this.musicUrl.length() > v2) {
            Log.e("MicroMsg.SDK.WXMusicObject", "checkArgs fail, musicUrl is too long");
            return v0;
        }

        if(this.musicLowBandUrl != null && this.musicLowBandUrl.length() > v2) {
            Log.e("MicroMsg.SDK.WXMusicObject", "checkArgs fail, musicLowBandUrl is too long");
            return v0;
        }

        return true;
    }

    public void serialize(Bundle arg3) {
        arg3.putString("_wxmusicobject_musicUrl", this.musicUrl);
        arg3.putString("_wxmusicobject_musicLowBandUrl", this.musicLowBandUrl);
        arg3.putString("_wxmusicobject_musicDataUrl", this.musicDataUrl);
        arg3.putString("_wxmusicobject_musicLowBandDataUrl", this.musicLowBandDataUrl);
    }

    public int type() {
        return 3;
    }

    public void unserialize(Bundle arg2) {
        this.musicUrl = arg2.getString("_wxmusicobject_musicUrl");
        this.musicLowBandUrl = arg2.getString("_wxmusicobject_musicLowBandUrl");
        this.musicDataUrl = arg2.getString("_wxmusicobject_musicDataUrl");
        this.musicLowBandDataUrl = arg2.getString("_wxmusicobject_musicLowBandDataUrl");
    }
}

